package com.tonghe.enums;

/**
 * @Date:2022/2/15- 02- 15- 13:32
 * 枚举类
 **/
public enum AppHttpCodeEnum {

    SUCCESS(200,"操作成功"),
    SEND_MAIL_SUCCESS(200,"邮件发送成功"),
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"), EMAIL_EXIST(503, "邮箱已存在"),
    NOT_EXIST(503,"不存在资源"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505,"用户名或密码错误"),
    CONTENT_NOT_NULL(506,"内容不能为空"),
    FILE_TYPE_ERROR(507,"文件格式错误"),
    USERNAME_NOT_NULL(508,"用户名不能为空"),
    PASSWORD_NOT_NULL(509,"密码不能为空"),
    EMAIL_NOT_NULL(510,"邮箱不能为空"),
    NICKNAME_NOT_NULL(511,"昵称 不能为空"),
    CODE_NOT_NULL(512,"验证码不能为空"),
    EMAIL_CODE_MISMATCHING(513,"验证码错误"),
    OBJECT_ISNULL(501,"对象为空"),
    NAME_EXITS(501,"该名称已存在"),
    EMAIL_CODE_PAST(514,"验证码过期");
    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
